package com.skivingcloud.report.constants;

import java.util.HashMap;
import java.util.Map;

/**
 * @author hushouquan
 * @since 2024/6/3
 */
public class ReportConstant{
    public static final String REPORT_BASE_URL = "/report";
    /**
     * 通用是否 是
     */
    public static final String COMMON_YES_OR_NO_YES = "1";
    /**
     * 通用是否 否
     */
    public static final String COMMON_YES_OR_NO_NO = "0";

    /**
     * 已支持的数据源
     */
    public final static String KUDU_IMAPLA = "kudu_impala";
    public final static String HTTP = "http";
    public final static String MYSQL = "mysql";
    public final static String ORACLE = "oracle";
    public final static String ELASTIC_SEARCH_SQL = "elasticsearch_sql";
    public final static String SQL_SERVER = "mssqlserver";
    public final static String JDBC = "jdbc";
    public final static String POSTGRESQL = "postgresql";
    public final static String DAMENG = "dameng";
    public final static String OPENGAUSS = "openGauss";
    public final static String KINGBASE = "Kingbase";
    public final static String INFLUXDB = "influxdb";
    public final static String TDENGINE = "tdengine";

    public final static Map<String, String> DRIVER_CLASS_MAP = new HashMap<>(){{
        put("mysql", "com.mysql.cj.jdbc.Driver");
        put("mssqlserver", "com.microsoft.sqlserver.jdbc.SQLServerDriver");
        put("oracle", "oracle.jdbc.driver.OracleDriver");
        put("postgresql", "org.postgresql.Driver");
        put("influxdb", "influxdb");
        put("dameng", "dm.jdbc.driver.DmDriver");
        put("clickhouse", "ru.yandex.clickhouse.ClickHouseDriver");
        put("tdengine", "com.taosdata.jdbc.TSDBDriver");
        put("Kingbase", "com.kingbase8.Driver");
        put("kudu_impala", "com.cloudera.impala.jdbc41.Driver");
        put("openGauss", "org.opengauss.Driver");
        put("jdbc", "");
    }};

    /**
     * 数据集类型
     */
    public enum DatasetTypeEnum{
        /**
         * sql
         */
        SQL("1"),
        /**
         * api
         */
        API("2");
        private final String code;// 状态值

        DatasetTypeEnum(String code) {
            this.code = code;
        }
        public String getCode () {
            return code;
        }
    }
}
